import fetch from '@/utils/fetch'

//车辆信息查询接口
export function getList(data) {
  return fetch({
    url: '/org/list',
    method: 'post',
    data
  })
}

//获取用户列表
export function getuserList(data) {
  return fetch({
    url: '/user/userList',
    method: 'post',
    data
  })
}

//用户禁用
export function forbind(id,data) {
  return fetch({
    url: '/user/enableUser/'+id,
    method: 'get',
    data
  })
}

//用户增加
export function addMember(data) {
  return fetch({
    url: '/user/addUser',
    method: 'post',
    data
  })
}

//修改用户信息
export function reviseMember(data) {
  return fetch({
    url: '/user/updateUser',
    method: 'post',
    data
  })
}

export function deleteMember(id) {
  return fetch({
    url: '/user/delUser/'+id,
    method: 'get',
  })
}
//组织信息接口
export function orgList() {
  const data = {}
  return fetch({
    url: '/org/list',
    method: 'post',
    data
  })
}

//角色信息接口
export function roleList() {
  return fetch({
    url: '/role/getRoleList',
    method: 'get',
  })
}

//添加角色
export function addRole(data) {
  return fetch({
    url: '/role/addOrUpdateRole',
    method: 'post',
    data
  })
}

//删除角色
export function delectRole(id) {
  return fetch({
    url: '/role/deleteRole/'+id,
    method: 'get',
  })
}

//查询角色权限
export function getRoleInfo(id) {
  return fetch({
    url: '/menu/tree/role/'+id,
    method: 'get',
  })
}

//查询系统菜单
export function getSystemMenu(data) {
  return fetch({
    url: '/menu/tree/list',
    method: 'post',
    data
  })
}
//给角色绑定ID
export function bindRole(data) {
  return fetch({
    url: '/roleMenu/bind',
    method: 'post',
    data
  })
}
